/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package view;

import java.beans.PropertyChangeListener;
import java.beans.PropertyChangeSupport;
import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Transient;

/**
 *
 * @author Mark
 */
@Entity
@Table(name = "massages", catalog = "ticketsaler", schema = "")
@NamedQueries({@NamedQuery(name = "Massages.findAll", query = "SELECT m FROM Massages m"), @NamedQuery(name = "Massages.findByMasid", query = "SELECT m FROM Massages m WHERE m.masid = :masid"), @NamedQuery(name = "Massages.findByMassage", query = "SELECT m FROM Massages m WHERE m.massage = :massage")})
public class Massages implements Serializable {
    @Transient
    private PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "MASID")
    private Integer masid;
    @Column(name = "MASSAGE")
    private String massage;

    public Massages() {
    }

    public Massages(Integer masid) {
        this.masid = masid;
    }

    public Integer getMasid() {
        return masid;
    }

    public void setMasid(Integer masid) {
        Integer oldMasid = this.masid;
        this.masid = masid;
        changeSupport.firePropertyChange("masid", oldMasid, masid);
    }

    public String getMassage() {
        return massage;
    }

    public void setMassage(String massage) {
        String oldMassage = this.massage;
        this.massage = massage;
        changeSupport.firePropertyChange("massage", oldMassage, massage);
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (masid != null ? masid.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Massages)) {
            return false;
        }
        Massages other = (Massages) object;
        if ((this.masid == null && other.masid != null) || (this.masid != null && !this.masid.equals(other.masid))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "view.Massages[masid=" + masid + "]";
    }

    public void addPropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.addPropertyChangeListener(listener);
    }

    public void removePropertyChangeListener(PropertyChangeListener listener) {
        changeSupport.removePropertyChangeListener(listener);
    }

}
